package com.googlecode.jkorpos.hangul;
/**
 * This enumeration represents Korean Jungseong.
 */
public enum Jungseong implements Jaso{
	/** filler */ FILLER(-1), 
	/** ㅏ */ A(0),
	/** ㅐ */ AE(1),
	/** ㅑ */ YA(2),
	/** ㅒ */ YAE(3),
	/** ㅓ */ EO(4),
	/** ㅔ */ E(5),
	/** ㅕ */ YEO(6),
	/** ㅖ */ YE(7),
	/** ㅗ */ O(8),
	/** ㅘ */ WA(9),
	/** ㅙ */ WAE(10),
	/** ㅚ */ OE(11),
	/** ㅛ */ YO(12),
	/** ㅜ */ U(13),
	/** ㅝ */ WEO(14),
	/** ㅞ */ WE(15),
	/** ㅟ */ WI(16),
	/** ㅠ */ YU(17),
	/** ㅡ */ EU(18),
	/** ㅢ */ YI(19),
	/** ㅣ */ I(20);
	
	public static final int START_INDEX = 0x1161;
	
	private final int offset;
	
	Jungseong(int offset){
		this.offset = offset;
	}

	public int getOffset() {
		return offset;
	}

	public char toChar() {
		return (char)(START_INDEX + offset);
	}

	public static Jungseong valueOf(int i) {
		return Jungseong.values()[i + 1];
	}
}
